{% extends "back.html" %}
{% block hello %}
    {% with messages = get_flashed_messages() %}
        {% if messages %}
            <ul class=flashes>
                {% for message in messages %}
                    <li style="color:red">{{ message }}</li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endwith %}
    <div class="tpl-content-wrapper" style="margin-top: -7px;">
        <div class="row">
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat blue">
                    <div class="visual">
                        <i class="am-icon-comments-o"></i>
                    </div>
                    <div class="details">
                        <div class="number"> {{ project_cout }} </div>
                        <div class="desc"> 项目</div>
                    </div>
                    <a class="more" href="{{ url_for('home.project') }}"> 查看项目
                        <i class="m-icon-swapright m-icon-white"></i>
                    </a>
                </div>
            </div>
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat red">
                    <div class="visual">
                        <i class="am-icon-bar-chart-o"></i>
                    </div>
                    <div class="details">
                        <div class="number"> {{ model_cout }}
                        </div>
                        <div class="desc"> 模块
                        </div>
                    </div>
                    <a class="more" href="{{ url_for('home.model') }}"> 查看更多
                        <i class="m-icon-swapright m-icon-white">
                        </i>
                    </a>
                </div>
            </div>
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat green">
                    <div class="visual">
                        <i class="am-icon-apple"></i>
                    </div>
                    <div class="details">
                        <div class="number">
                            {{ jiekou }}
                        </div>
                        <div class="desc"> 接口</div>
                    </div>
                    <a class="more" href="{{ url_for('home.interface') }}"> 查看更多
                        <i class="m-icon-swapright m-icon-white"></i>
                    </a>
                </div>
            </div>
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat purple">
                    <div class="visual">
                        <i class="am-icon-android"></i>
                    </div>
                    <div class="details">
                        <div class="number"> {{ yongli }} 执行：{{ all_run_case_count }}</div>
                        <div class="desc"> 测试用例</div>
                    </div>
                    <a class="more" href="{{ url_for('home.yongli') }}"> 查看更多
                        <i class="m-icon-swapright m-icon-white"></i>
                    </a>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="am-u-lg-3 am-u-md-6 am-u-sm-12">
                <div class="dashboard-stat blue">
                    <div class="visual">
                        <i class="am-icon-comments-o"></i>
                    </div>
                    <div class="details">
                        <div class="number"> {{ report }} </div>
                        <div class="desc"> 测试报告</div>
                    </div>
                    <a class="more" href="{{ url_for('home.test_rep') }}"> 更多
                        <i class="m-icon-swapright m-icon-white"></i>
                    </a>
                </div>
            </div>
        </div>

        <div>
            <strong>我的定时任务</strong>
            <table class="am-table am-table-striped am-table-hover table-main ">
                <thead>
                <tr>
                    <th>定时任务名称</th>
                    <th>下次执行时间</th>
                    <th>任务运行状态</th>
                </tr>
                </thead>
                {% for task in my_tasl %}
                    <tr>
                        <td>{{ task.taskname }}</td>
                        <td>{{ task.next_run }}</td>
                        {% if task.run_status=='创建'or task.run_status=='关闭' %}
                            <td>
                                <a href="{{ url_for('task.starttask',id=task.id) }}">
                                    <input type="button" class="btn btn-default" value="启动">
                                </a>
                            </td>
                        {% elif task.run_status=='启动' %}
                            <td>
                                <a href="{{ url_for('task.zantingtask',id=task.id) }}">
                                    <input type="button" class="btn btn-success" value="暂停">
                                </a>
                                <a href="{{ url_for('task.yichutask',id=task.id) }}">
                                    <input type="button" class="btn btn-danger" value="移除">
                                </a>
                            </td>
                        {% elif task.run_status=='暂停' %}
                            <td>
                                <a href="{{ url_for('task.huifutask',id=task.id) }}">
                                    <input type="button" class="btn btn-success" value="恢复">
                                </a>
                                <a href="{{ url_for('task.yichutask',id=task.id) }}">
                                    <input type="button" class="btn btn-danger" value="移除">
                                </a>
                            </td>
                        {% endif %}
                    </tr>
                {% endfor %}
            </table>
        </div>
    </div>
{% endblock %}